package cn.school.stu.evaluation.dao;

import cn.school.stu.evaluation.entity.StuEvaIndicator;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author: lx
 * @date: 2023/5/24 11:09
 * @description: 考评指标dao层
 */
@Mapper
@Component
public interface StuEvaIndicatorDao extends BaseMapper<StuEvaIndicator> {

    /**
     * 条件查询考评指标数量
     * @param indicatorName
     * @param tenantId 租户id
     * @return
     */
    int findStuEvaIndicatorCount(@Param("indicatorName") String indicatorName,
                              @Param("tenantId")String tenantId);

    /**
     * 分页查询考评指标

     * @param tenantId 租户id
     * @return
     */
    List<StuEvaIndicator> findStuEvaIndicatorPageList(@Param("tenantId")String tenantId, @Param("pid")String pid);


    StuEvaIndicator findStuEvaIndicatorList(@Param("tenantId")String tenantId, @Param("pid")String pid, @Param("id") Long id);

//    List<StuEvaIndicator> findChildStuEvaIndicator(Integer indicatorId);

    /**
     * 根据指标名称查询指标
     * @param indicatorName
     * @param tenantId
     * @return
     */
    List<StuEvaIndicator> findStuEvaIndicatorByName(@Param("indicatorName") String indicatorName,
                                              @Param("tenantId")String tenantId);

    /**
     * 根据pid查询指标
     * @param pid
     * @return
     */
    List<StuEvaIndicator> findStuEvaIndicatorByPid(@Param("pid")Long pid);

    List<StuEvaIndicator> findStuEvaIndicatorByIds(@Param("ids")String[] ids);

    StuEvaIndicator findStuEvaIndicatorById(String ids);
}
